package cn.org.tpeach.nosql.redis.bean;

import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
@Builder
public class DbAmount implements Serializable {
    private int dbIndex;
    private Long dbSize;
    /**
     *
     */
    private int matchingQuantity;

    @Override
    public String toString() {
        if(matchingQuantity < 0 || dbSize == matchingQuantity){
            return "db" + this.getDbIndex() + "(" + this.getDbSize() + ")";
        }
        return "db" + this.getDbIndex() + "(" + this.getDbSize() + ")["+matchingQuantity+"]";
    }
}
